﻿using Nest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ElasticSearchDemo.Models
{
    [ElasticsearchType(RelationName = "persons",IdProperty ="Id")]
    public class Persons
    {
        [Number(Name="id")]
        public int Id { get; set; }

        [Keyword(Name="name")]
        public string Name { get; set; }

        [Number(Name="age")]
        public int Age { get; set; }

        [Text(Name = "enterprise_name",Analyzer = "ik_max_word",SearchAnalyzer ="ik_smart")]
        public string EnterpriseName { get; set; }

        [Date(Name="createtime")]
        public DateTime CreateTime { get; set; }
    }
}
